package com.toocms.jinjuhang.config

enum class SectionLayout(val code: String, val imageNumber: Int) {
    SINGLE("1", 1), //单图
    LEFT_TWO_RIGHT_ONE("2", 3), //左二右一(竖排)
    LEFT_ONE_RIGHT_TWO("3", 3), //左一右二(竖排)
    HORIZONTAL_THREE("4", 3), //三连并排
    LEFT_TWO_RIGHT_TWO("5", 4), //田字格
    LEFT_ONE_RIGHT_ONE("6", 2); //左一右一

    companion object {
        fun code2Layout(code: String?) = when (code) {
            SINGLE.code -> SINGLE
            LEFT_TWO_RIGHT_ONE.code -> LEFT_TWO_RIGHT_ONE
            LEFT_ONE_RIGHT_TWO.code -> LEFT_ONE_RIGHT_TWO
            HORIZONTAL_THREE.code -> HORIZONTAL_THREE
            LEFT_TWO_RIGHT_TWO.code -> LEFT_TWO_RIGHT_TWO
            LEFT_ONE_RIGHT_ONE.code -> LEFT_ONE_RIGHT_ONE
            else -> null
        }

    }

}